package edi.dao;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
  

import java.util.List;
import edi.entities.DocTypeEntity; 

@Repository
@Transactional
public class DocTypeDaoImp extends HibernateCrudDao<DocTypeEntity> implements DocTypeDao {
    
    public DocTypeDaoImp() {
	super(DocTypeEntity.class);
    }

    @Override
    public List<DocTypeEntity> findByExtension(String ext) {
	return session().createQuery("from DocTypeEntity where dctExtension = :ext").setString("ext", ext).list();
        
        
    }   
        
    @Override
    public List<DocTypeEntity> findByName(String name) {
	return session().createQuery("from DocTypeEntity where dctName = :name").setString("name", name).list();
    } 
       
            
}  